﻿/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Foundation Framework Class Library
 * Version 2.00
 * 
 * ZIP Entry Collection Class
 *      Provides a custom collection class for storing ZipEntry instances.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
using System;

namespace Adaptive.Foundation.IO.Zip
{
    /// <summary>
    /// Provides a custom collection class for storing <see cref="ZipEntry"/> instances.
    /// </summary>
    public class ZipEntryCollection : GenericCollectionBase<ZipEntry>
    {
        /*--------------------------------------------------------------------------------
         * Constructor / Dispose / Destructor Methods
         *------------------------------------------------------------------------------*/
        #region Constructor / Dispose / Destructor Methods
        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        /// <remarks>
        /// This is the default constructor.
        /// </remarks>
        public ZipEntryCollection()
            : base()
        {
        }
        #endregion

        /*--------------------------------------------------------------------------------
		 * Protected Methods
		 *------------------------------------------------------------------------------*/
        #region Protected Methods
        /// <summary>
        /// Gets the reference key for the object being appended to the collection instance.
        /// </summary>
        /// <param name="itemToGetKeyFor">
        /// The object being appended.
        /// </param>
        /// <returns>
        /// The reference key vlaue to use.
        /// </returns>
        protected override string GetKeyForObject(ZipEntry itemToGetKeyFor)
        {
            string returnValue = string.Empty;						//Return value.

            if (itemToGetKeyFor != null)
                returnValue = itemToGetKeyFor.Name;

            return returnValue;
        }
        #endregion
    }
}